package com.openbravo.pos.inventory;

import com.openbravo.pos.panels.ComboItemLocal;

public class MovementReason extends ComboItemLocal
{
  public static final MovementReason IN_PURCHASE = new MovementReason(Integer.valueOf(1), "stock.in.purchase");
  public static final MovementReason IN_REFUND = new MovementReason(Integer.valueOf(2), "stock.in.refund");
  public static final MovementReason IN_MOVEMENT = new MovementReason(Integer.valueOf(4), "stock.in.movement");
  public static final MovementReason OUT_SALE = new MovementReason(Integer.valueOf(-1), "stock.out.sale");
  public static final MovementReason OUT_REFUND = new MovementReason(Integer.valueOf(-2), "stock.out.refund");
  public static final MovementReason OUT_BREAK = new MovementReason(Integer.valueOf(-3), "stock.out.break");
  public static final MovementReason OUT_MOVEMENT = new MovementReason(Integer.valueOf(-4), "stock.out.movement");
  public static final MovementReason OUT_CROSSING = new MovementReason(Integer.valueOf(1000), "stock.out.crossing");

  private MovementReason(Integer paramInteger, String paramString)
  {
    super(paramInteger, paramString);
  }

  public boolean isInput()
  {
    return this.m_iKey.intValue() > 0;
  }

  public Double samesignum(Double paramDouble)
  {
    if ((paramDouble == null) || (this.m_iKey == null))
      return paramDouble;
    if (((this.m_iKey.intValue() > 0) && (paramDouble.doubleValue() < 0.0D)) || ((this.m_iKey.intValue() < 0) && (paramDouble.doubleValue() > 0.0D)))
      return new Double(-paramDouble.doubleValue());
    return paramDouble;
  }

  public Double getPrice(Double paramDouble1, Double paramDouble2)
  {
    if ((this == IN_PURCHASE) || (this == OUT_REFUND) || (this == OUT_BREAK))
      return paramDouble1;
    if ((this == OUT_SALE) || (this == IN_REFUND))
      return paramDouble2;
    return null;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.inventory.MovementReason
 * JD-Core Version:    0.6.0
 */